<template>
  <div>
<div class="zhlogin"> <span></span> 账号登录</div>
<input type="text" placeholder="请输入账号" v-model="uname"><br>
<input type="password" placeholder="请输入密码" v-model="password"><br>
<button @click="add">登录</button>
<p>还没有账号，去注册</p>
  </div>
</template>

<script>
export default {
  name: 'Hm05LogIn',

  data () {
    return {
      uname: '',
      password: ''
    }
  },

  mounted () {

  },

  methods: {
    async add () {
      // console.log(123)
      const res = await this.$http(
        {
          method: 'post',
          url: 'user/login',
          data: {
            username: this.uname,
            password: this.password
          }
        }
      )
      console.log(res)
      // this.$dialog.alert({
      //   message: '登录成功'
      // })
      // setTimeout(async () => {
      await this.$router.push('/layout')
      // }, 2000)
    }

  }
}
</script>

<style  scoped>
*{
  margin: 0;
  padding: 0;
}
.zhlogin{
text-align: center;
  height: 50px;
  line-height: 50px;
  background-color: palegreen;
  color: white;
  font-size: 20px;
}
input{
  height: 60px;
  width: 350px;
  border: none;
  border-bottom: 1px solid #999;
}
button{
width: 320px;
height: 50px;
background-color: palegreen;
border: none;
margin-left: 18px;
margin-top: 20px;
}
p{
  font-size: 12px;
  color: #666;
  margin-left: 120px;
  margin-top: 50px;
}
</style>
